package com.alon.spring01.common.config.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 * @program: spring01
 * @description: 获取spring 的上下文
 * @author: yulongguang
 * @create: 2019-05-15 14:44
 **/
@Component
public class SpringUtils extends SpringBeanUtil {

    private Environment env;

    /**
     * 获取上下文
     */
    public static ApplicationContext getCtx() {
        return getApplicationContext();
    }

    /**
     * 获取上下文的环境
     */
    public static Environment getEnv() {
        return getApplicationContext().getEnvironment();
    }


}
